package com.hqyj.service.service;

import com.hqyj.dao.dao.Yan_Accountdao;
import com.hqyj.dao.dao.Yan_allcustomerdao;
import com.hqyj.dao.dao.Yan_myList;
import com.hqyj.pojo.Yan_addcustomerpojo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class YanAddCustomerServiceImpl implements YanAddCustomerService{
    @Autowired(required = false)
    Yan_Accountdao yan_accountdao;
    @Autowired(required = false)
    Yan_myList yan_myList;
    @Autowired(required = false)
    Yan_allcustomerdao yan_allcustomerdao;

    @Override
    public int add(Yan_addcustomerpojo yan_addcustomerpojo) {
        return yan_accountdao.add(yan_addcustomerpojo);
    }

    @Override
    public List<Yan_addcustomerpojo> search(String userName) {
        return yan_accountdao.search(userName);
    }

    @Override
    public int updateAccount(String userName, String address, String sex, String phone, String manager) {
        int data = yan_accountdao.updateAccount(userName, address, sex, phone, manager);
        System.out.println("这是service的"+data);
        if (data == 1) {
            return 1;
        }
        return 0;
    }

    @Override
    public List<Yan_addcustomerpojo> getList(String userName) {
        return yan_myList.getList(userName);
    }

    @Override
    public List<Yan_addcustomerpojo> getAllList() {
        return yan_allcustomerdao.getAllList();
    }


}
